package ru.papergames.model.proxies
{
	import ru.papergames.controller.notifications.FrontendNotifications;
	import ru.papergames.model.vo.LoginVO;
	
	public class LogoutProxy extends MainHTTPProxy
	{
		
		public static const NAME:String = 'LogoutProxy';
		
		//methods
		public static const LOGOUT:String = 'logout';
		
		//responses
		
		public static const LOGOUT_START:String = LOGOUT + HTTPProxy.START_NOTE_POSTFIX;
		public static const LOGOUT_SUCCESS:String = LOGOUT + HTTPProxy.SUCCESS_NOTE_POSTFIX;
		public static const LOGOUT_FAULT:String = LOGOUT + HTTPProxy.FAULT_NOTE_POSTFIX;
		
		
		public function LogoutProxy(url:String, lvo:LoginVO)
		{
			super(NAME, url, lvo);
			this.useOperationParam = false;
		}
		
		override public function onRegister():void {
			super.onRegister();
		}
		
		override public function onRemove():void {
			super.onRemove();
			
			this.setData(null);
		}
		
		public function get loginVO():LoginVO {
			return this.data as LoginVO;
		}
		
		
		override protected function parseResponse(data:XML, ownResponse:Boolean):void {
			
		}
		
					
		/*****  Call handlers  *****/
		
		/* Logout */		
		public function logout_Result(data:XML):String {
			loginVO.isLoggedIn = false;
			
			return LOGOUT_SUCCESS;
		}
		
	}
}